<layout name='Layout/layout_main' />
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.js"></script>
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.setting.js"></script>
<script type="text/javascript">
	function save() {
		editor.sync();
		if (check_form("form_data")) {
			sendForm("form_data", "{:U('save')}");
		}
	}


	$(document).ready(function() {
		editor_init();

		$(function() {

			$(".input-date").datepicker();

			$("#priority").val(3);
			$("#slider-range-priority").slider({
				range : "min",
				min : 1,
				max : 5,
				value : 3,
				slide : function(event, ui) {
					$("#priority").val(ui.value);
					$("div.slider_box div.ui-slider").css("background-color", schedule_bg(ui.value));
					$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(ui.value));
				}
			});
			$("div.slider_box div.ui-slider").css("background-color", schedule_bg(3));
			$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(3));
		})
	});
	function month_view() {
		window.open("__URL__", "_self");
	}
</script>
<div class="title panel panel-default">
	<div class="panel-body">
		<h3 class="col-md-12">新建待办事项</h3>
	</div>
</div>
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data">
	<input type="hidden" id="ajax" name="ajax" value="0">
	<input type="hidden" id="add_file" name="add_file">
	<input type="hidden" id="opmode" name="opmode" value="add">
	<div class="">
		<div class="row form-horizontal">
			<div class="form-group">
				<label class="col-md-2 control-label" for="name">标题：</label>
				<div class="col-md-10">
					<input class="col-md-12" type="text" id="name" name="name" value="{$vo.name}"  check="require" msg="请输入标题">
				</div>
			</div>
		</div>
		<div class="row form-horizontal">
			<div class="form-group col-md-6">
				<label class="col-md-2 control-label" for="end_date">结束：</label>
				<div class="col-md-10">
					<input type="text" id="end_date" name="end_date" readonly="readonly" value="{$vo.end_date}" class="input-date">
				</div>
			</div>
			<div class="form-group col-md-6">
				<label class="col-md-2 control-label" for="company">优先级：</label>
				<div class="col-md-10">
					<input type="hidden" id="priority" name="priority"/>
					<div  class="slider_box" >
						<div class="left" style="padding-right:12px">
							低
						</div>
						<div id="slider-range-priority"></div>
						<div class="left"  style="padding-left:12px">
							高
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row form-horizontal">
			<div class="form-group">
				<label class="col-md-2 control-label" for="name">附件：</label>
				<div class="col-md-10">
					<include file="Layout:uploader" />
				</div>
			</div>
		</div>
		<div class="row form-horizontal">
			<div class="form-group">
				<textarea id="content" name="content" style="width:100%;height:300px;">{$vo.content}</textarea>
			</div>
		</div>

	</div>
	<div class="action">
		<input class="btn btn-default" type="button" value="保存" onclick="save();">
		<input  class="btn btn-default" type="button" value="取消" onclick="go_return_url();">
	</div>
</form>